// 评论接口模块
import axios from '@/utils/axios'

// 获取文章列表
export const getComments = params => {
    return axios({
        method: "GET",
        url: "/v1_0/comments",
        params
    })
};

// 评论点赞
export const addCommentLike = target => {
    return axios({
        method: 'POST',
        url: '/v1_0/comment/likings',
        data: {
            target
        }
    })
};

// 取消评论点赞
export const deleteCommentLike = target => {
    return axios({
        method: 'DELETE',
        url: `/v1_0/comment/likings/${target}`,

    })
}

// 添加评论或评论回复
export const addComment = data => {
    return axios({
        method: 'POST',
        url: '/v1_0/comments',
        data
    })
}